package com.zj.fx.model.rpa;

import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.date.DateUtil;
import lombok.Data;

import java.util.Date;

@Data
public class RpaRecordPush implements Serializable {

    private static final long serialVersionUID = 1L;


    @ApiModelProperty(value = "主键id")
    private String id;

    @ApiModelProperty(value = "任务名称")
    private String taskname;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "开始时间")
    private Date starttime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "结束时间")
    private Date endtime;

    @ApiModelProperty(value = "执行结果（0失败1成功）")
    private String status;

    @ApiModelProperty(value = "执行条数")
    private String count;

    @ApiModelProperty(value = "参数1")
    private String dataparam1;

    @ApiModelProperty(value = "参数2")
    private String dataparam2;

    @ApiModelProperty(value = "参数3")
    private String dataparam3;


    public RpaRecordPush(String id, String taskname, Date starttime, Date endtime, String status, String count, String dataparam1, String dataparam2, String dataparam3) {

        this.id = id;

        this.taskname = taskname;

        this.starttime = starttime;

        this.endtime = endtime;

        this.status = status;

        this.count = count;

        this.dataparam1 = dataparam1;

        this.dataparam2 = dataparam2;

        this.dataparam3 = dataparam3;

    }

    public RpaRecordPush() {
        super();
    }

    public String dateToStringConvert(Date date) {
        if (date != null) {
            return DateUtil.format(date, "yyyy-MM-dd HH:mm:ss");
        }
        return "";
    }


}